/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ages.test.fjump2

import com.ages.graphics.GLDraw
import com.ages.graphics.ViewportSwitcher
import com.ages.math.Vector3D
import com.ages.math.Vector
import com.sun.opengl.util.GLUT
import javax.media.opengl.GL
import com.ages.entity.Actor

class Platform(v:Vector3D) extends Actor{
  pos = v
  def think(){}
  
  def draw(gl:GL)
  {
     def ball = () =>{
      val mat_ambient = Array[Float](0.7f,0.7f,0.7f,1)
      val mat_diffuse = Array[Float](0.7f,0.1f,0.1f,1)
      val mat_specular = Array[Float](1,1,1,1)
      val high_shininess = Array[Float](100.0f)
      val no_mat = Array[Float](0,0,0,1)
      gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT, mat_ambient,0);
      gl.glMaterialfv(GL.GL_FRONT, GL.GL_DIFFUSE, mat_diffuse,0);
      gl.glMaterialfv(GL.GL_FRONT, GL.GL_SPECULAR, mat_specular,0);
      gl.glMaterialfv(GL.GL_FRONT, GL.GL_SHININESS, high_shininess,0);
      gl.glMaterialfv(GL.GL_FRONT, GL.GL_EMISSION, no_mat,0);
      gl.glColor4d(0,1,0,1)
      gl.glMatrixMode(GL.GL_MODELVIEW)
      val glut = new GLUT()
      gl.glScaled(4,0.5,1)
      glut.glutSolidCube(1);
    }
    val spot:Vector3D = Vector3D(pos.X,pos.Y,pos.Z-7)
    ViewportSwitcher.setup3DView(gl)

    GLDraw draw ball at spot on gl

  }


}
